# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=libnumbertext
pkgver=1.0
pkgrel=1
pkgdesc="Number to number name and money text conversion library"
arch=('x86_64')
url="https://github.com/Numbertext/libnumbertext"
license=('LGPL3' 'custom')
depends=('gcc-libs')
source=(https://github.com/Numbertext/libnumbertext/archive/$pkgver.tar.gz
        libnumbertext-updateautotools.patch)
noextract=()
sha256sums=('db1864aa672e3d8e094f2cc64db1e1dd280266dd6c76899415adb91012b1da72'
            '4c1be70cbb6c7b5e2f9d3842ad83ea95971d99663768e5df2ac74956fc4555bd')

prepare() {
  cd "$pkgname-$pkgver"
  patch -Np1 -i ../libnumbertext-updateautotools.patch
  autoreconf -vfi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr
  make
}

check() {
  cd "$pkgname-$pkgver"
  make -k check
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
  # add dual license file
  install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 COPYING
}
